<template>
	<view class="preview">
		<view style="position: relative">
			<image src="@/static/mine/minebg.png" style="width: 100%; height: 450rpx"></image>
			<view class="align-end" style="position: absolute; top: 0; width: 100%; height: 100%; padding: 0 70rpx">
				<u-navbar bgColor="rgba(0,0,0,0)">
					<view slot="left" class="align-center">
						<image @click="$tools.back()" src="@/static/login/back4.png" style="width: 36rpx; height: 36rpx"></image>
					</view>
					<view slot="center">
						<view style="font-weight: 600; font-size: 36rpx; color: #fff">我的简历</view>
					</view>
				</u-navbar>
				<view class="flex-between">
					<view class="">
						<view style="font-weight: 600; font-size: 48rpx; color: #ffffff; margin-bottom: 10rpx">{{ userInfo.name }}</view>
						<view style="font-weight: 400; font-size: 28rpx; color: #ffffff">{{ userInfo.sex == 1 ? '男' : '女' }} · {{ userInfo.age }}岁 · {{ userInfo.phone }}</view>
					</view>
					<view class="">
						<image :src="userInfo.head" style="width: 320rpx; height: 280rpx" mode="aspectFit"></image>
					</view>
				</view>
			</view>
		</view>
		<!--  -->
		<view style="padding: 32rpx">
			<view style="padding-bottom: 50rpx; border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
				<view style="font-weight: 600; font-size: 32rpx; color: #333333; margin-bottom: 34rpx">工作意向</view>
				<view class="flex-wrap" style="margin-bottom: 50rpx">
					<view
						style="
							background: rgba(10, 124, 232, 0.1);
							border-radius: 8rpx;
							border: 1rpx solid #1365f9;
							padding: 16rpx 40rpx;
							margin-right: 20rpx;
							margin-bottom: 20rpx;
						"
					>
						{{ userInfo.workIntention }}
					</view>
					<view
						style="
							background: rgba(10, 124, 232, 0.1);
							border-radius: 8rpx;
							border: 1rpx solid #1365f9;
							padding: 16rpx 40rpx;
							margin-right: 20rpx;
							margin-bottom: 20rpx;
						"
					>
						{{ userInfo.income }}
					</view>
					<view
						style="
							background: rgba(10, 124, 232, 0.1);
							border-radius: 8rpx;
							border: 1rpx solid #1365f9;
							padding: 16rpx 40rpx;
							margin-right: 20rpx;
							margin-bottom: 20rpx;
						"
					>
						{{ userInfo.workTime }}
					</view>
					<view
						style="
							background: rgba(10, 124, 232, 0.1);
							border-radius: 8rpx;
							border: 1rpx solid #1365f9;
							padding: 16rpx 40rpx;
							margin-right: 20rpx;
							margin-bottom: 20rpx;
						"
					>
						{{ userInfo.workAddress }}
					</view>
				</view>
				<view style="font-weight: 600; font-size: 32rpx; color: #333333; margin-bottom: 34rpx">经历技能</view>
				<view style="font-weight: 600; font-size: 28rpx; color: #333333; margin-bottom: 14rpx">{{ userInfo.majorStudied }}</view>
				<view style="font-weight: 300; font-size: 28rpx; color: #999999">{{ userInfo.graduationDate }} {{ userInfo.culture }}</view>
				<view style="margin-top: 20rpx">
					<u-upload :fileList="fileList2" name="2" :deletable="false" :maxCount="0" width="88" height="88"></u-upload>
				</view>
			</view>
			<view style="padding-bottom: 30rpx; border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
				<view style="font-weight: 600; font-size: 32rpx; color: #333333; margin-bottom: 34rpx">个人形象</view>
				<view class="flex-between1" style="padding: 20rpx 0">
					<text style="font-weight: 400; font-size: 28rpx; color: #333333">身高</text>
					<text style="font-weight: 400; font-size: 28rpx; color: #999999">{{ userInfo.height || '' }}cm</text>
				</view>
				<view class="flex-between1" style="padding: 20rpx 0">
					<text style="font-weight: 400; font-size: 28rpx; color: #333333">体重</text>
					<text style="font-weight: 400; font-size: 28rpx; color: #999999">{{ userInfo.weight || '' }}kg</text>
				</view>
				<view class="flex-between1" style="padding: 20rpx 0">
					<text style="font-weight: 400; font-size: 28rpx; color: #333333">是否有明显纹身</text>
					<text style="font-weight: 400; font-size: 28rpx; color: #999999">{{ userInfo.tattoo == 1 ? '是' : '否' }}</text>
				</view>
				<view class="flex-between1" style="padding: 20rpx 0">
					<text style="font-weight: 400; font-size: 28rpx; color: #333333">身体状况</text>
					<text style="font-weight: 400; font-size: 28rpx; color: #999999">{{ userInfo.body }}</text>
				</view>
				<view class="flex-between1" style="padding: 20rpx 0">
					<text style="font-weight: 400; font-size: 28rpx; color: #333333">是否上社保</text>
					<text style="font-weight: 400; font-size: 28rpx; color: #999999">{{ userInfo.social == 1 ? '是' : '否' }}</text>
				</view>
				<view class="flex-between1" style="padding: 20rpx 0">
					<text style="font-weight: 400; font-size: 28rpx; color: #333333">备注</text>
					<text style="font-weight: 400; font-size: 28rpx; color: #999999">{{ userInfo.remark }}</text>
				</view>
				<view style="padding: 20rpx 0" v-if="fileList3.length">
					<text style="font-weight: 400; font-size: 28rpx; color: #333333">健康证</text>
					<u-upload :fileList="fileList3" name="2" :deletable="false" :maxCount="0" width="88" height="88"></u-upload>
				</view>
			</view>
			<view style="padding-bottom: 30rpx; border-bottom: 1rpx solid #eeeeee; margin-bottom: 30rpx">
				<view style="font-weight: 600; font-size: 32rpx; color: #333333; margin-bottom: 34rpx">工作经历</view>
				<view v-for="(item, index) in workList" :key="index" style="margin-bottom: 40rpx">
					<view>
						<view class="flex-between1" style="margin-bottom: 14rpx">
							<text style="font-weight: 600; font-size: 28rpx; color: #333333">{{ item.companyName }}</text>
							<!-- <image src="@/static/mine/mineright.png" style="width: 16rpx; height: 26rpx"></image> -->
						</view>
						<view style="margin-bottom: 26rpx">
							<text style="font-weight: 300; font-size: 28rpx; color: #999999">{{ item.postName }}</text>
							<text style="font-weight: 300; font-size: 28rpx; color: #999999; margin-left: 60rpx">{{ item.timeStart }}-{{ item.timeEnd }}</text>
						</view>
						<view v-html="item.content.replace(/\n/g, '<br>')" style="font-weight: 300; font-size: 28rpx; color: #999999"></view>
					</view>
				</view>
			</view>
			<view style="padding-bottom: 30rpx">
				<view style="font-weight: 600; font-size: 32rpx; color: #333333; margin-bottom: 34rpx">学历证书</view>
				<view class="">
					<u-upload :fileList="fileList4" name="2" :deletable="false" :maxCount="0" width="400" height="400"></u-upload>
				</view>
			</view>
			<view style="padding-bottom: 30rpx">
				<view style="font-weight: 600; font-size: 32rpx; color: #333333; margin-bottom: 34rpx">荣誉证书</view>
				<view class="">
					<u-upload :fileList="fileList5" name="2" :deletable="false" :maxCount="0" width="400" height="400"></u-upload>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			fileList1: [],
			fileList2: [],
			fileList3: [],
			fileList4: [],
			fileList5: [],
			userInfo: {},
			workList: []
		};
	},
	onShow() {
		this.init();
	},
	methods: {
		init() {
			this.$request('front/user/userInfo').then((res) => {
				console.log(res, '个人信息');
				this.userInfo = res.obj.userInfo;
				this.workList = res.obj.workList;

				if (this.userInfo.workImage) {
					const imglist = this.userInfo.workImage.split(',');
					imglist.map((item, index) => {
						this.$set(this.fileList1, index, { url: item });
					});
				}
				if (this.userInfo.skills) {
					const imglist1 = this.userInfo.skills.split(',');
					imglist1.map((item, index) => {
						this.$set(this.fileList2, index, { url: item });
					});
				}
				if (this.userInfo.health) {
					const imglist2 = this.userInfo.health.split(',');
					imglist2.map((item, index) => {
						this.$set(this.fileList3, index, { url: item });
					});
				}
				if (this.userInfo.education) {
					const imglist4 = this.userInfo.education.split(',');
					imglist4.map((item, index) => {
						this.$set(this.fileList4, index, { url: item });
					});
				}
				if (this.userInfo.honor) {
					const imglist5 = this.userInfo.honor.split(',');
					imglist5.map((item, index) => {
						this.$set(this.fileList5, index, { url: item });
					});
				}
			});
		}
	}
};
</script>

<style lang="less" scoped>
.preview {
	.box1 {
	}
}
</style>
